package day11.day12;

/**
 * @author oldliu
 * @since 1.0
 */
public class Sonar {
    private String brand;
    //...

    public void scan(Swiming w){
        System.out.println(brand+"扫描到了移动物体："+w);
        w.swim();//!!!
        if(w instanceof Qianting){
            Qianting q=(Qianting)w;
            System.out.println("炸掉他");
        }
    }
}
